/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('appstream-center', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model FindIdpListByLoginIdentifierRequest {
  availableFeatures?: map[string]string(name='AvailableFeatures'),
  clientChannel?: string(name='ClientChannel', example='pc'),
  clientId?: string(name='ClientId', example='370b56f8-2812-4b6c-bfa6-2560791c****'),
  clientIp?: string(name='ClientIp'),
  clientOS?: string(name='ClientOS', example='windows_\\\\"Windows 10 Enterprise\\\\" 10.0 (Build 14393)'),
  clientVersion?: string(name='ClientVersion', example='2.0.1-D-20211008.101607'),
  loginIdentifier?: string(name='LoginIdentifier', description='This parameter is required.', example='Aliyun123***'),
  supportTypes?: [ string ](name='SupportTypes'),
  uuid?: string(name='Uuid', example='2943802884B27030B6759F9132B2****'),
}

model FindIdpListByLoginIdentifierShrinkRequest {
  availableFeaturesShrink?: string(name='AvailableFeatures'),
  clientChannel?: string(name='ClientChannel', example='pc'),
  clientId?: string(name='ClientId', example='370b56f8-2812-4b6c-bfa6-2560791c****'),
  clientIp?: string(name='ClientIp'),
  clientOS?: string(name='ClientOS', example='windows_\\\\"Windows 10 Enterprise\\\\" 10.0 (Build 14393)'),
  clientVersion?: string(name='ClientVersion', example='2.0.1-D-20211008.101607'),
  loginIdentifier?: string(name='LoginIdentifier', description='This parameter is required.', example='Aliyun123***'),
  supportTypes?: [ string ](name='SupportTypes'),
  uuid?: string(name='Uuid', example='2943802884B27030B6759F9132B2****'),
}

model FindIdpListByLoginIdentifierResponseBody = {
  idpInfos?: [ 
    {
      accountType?: string(name='AccountType', example='simple'),
      cookies?: string(name='Cookies', example='null'),
      idpId?: string(name='IdpId', example='idp-hlyexfvwert9m8****'),
      idpName?: string(name='IdpName'),
      idpNameEN?: string(name='IdpNameEN'),
      idpProvider?: string(name='IdpProvider'),
      jumpSwitch?: string(name='JumpSwitch', example='true'),
      ssoProtocol?: string(name='SsoProtocol', example='SAML'),
      ssoServiceUrl?: string(name='SsoServiceUrl'),
    }
  ](name='IdpInfos'),
  officeSiteInfo?: {
    accessType?: string(name='AccessType', example='INTERNET'),
    officeSiteId?: string(name='OfficeSiteId', example='cn-shanghai+dir-448204****'),
    providerId?: string(name='ProviderId', example='26842'),
    regionId?: string(name='RegionId', example='cn-hangzhou'),
    ssoServiceUrl?: string(name='SsoServiceUrl'),
  }(name='OfficeSiteInfo'),
  popRegionConfig?: map[string]string(name='PopRegionConfig'),
  profileRegion?: string(name='ProfileRegion', example='cn_hangzhou'),
  requestId?: string(name='RequestId', example='AD2D0761-1FE5-549D-B169-D3F8D19C****'),
  tenantAliasInfo?: {
    accessType?: string(name='AccessType', example='INTERNET'),
    tenantAlias?: string(name='TenantAlias', example='Or09****'),
  }(name='TenantAliasInfo'),
}

model FindIdpListByLoginIdentifierResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FindIdpListByLoginIdentifierResponseBody(name='body'),
}

/**
 * @summary 身份认证查询接口
 *
 * @param tmpReq FindIdpListByLoginIdentifierRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FindIdpListByLoginIdentifierResponse
 */
async function findIdpListByLoginIdentifierWithOptions(tmpReq: FindIdpListByLoginIdentifierRequest, runtime: $RuntimeOptions): FindIdpListByLoginIdentifierResponse {
  tmpReq.validate();
  var request = new FindIdpListByLoginIdentifierShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.availableFeatures)) {
    request.availableFeaturesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.availableFeatures, 'AvailableFeatures', 'json');
  }
  var query = {};
  if (!$isNull(request.availableFeaturesShrink)) {
    query['AvailableFeatures'] = request.availableFeaturesShrink;
  }
  if (!$isNull(request.clientIp)) {
    query['ClientIp'] = request.clientIp;
  }
  var body : map[string]any = {};
  if (!$isNull(request.clientChannel)) {
    body['ClientChannel'] = request.clientChannel;
  }
  if (!$isNull(request.clientId)) {
    body['ClientId'] = request.clientId;
  }
  if (!$isNull(request.clientOS)) {
    body['ClientOS'] = request.clientOS;
  }
  if (!$isNull(request.clientVersion)) {
    body['ClientVersion'] = request.clientVersion;
  }
  if (!$isNull(request.loginIdentifier)) {
    body['LoginIdentifier'] = request.loginIdentifier;
  }
  if (!$isNull(request.supportTypes)) {
    body['SupportTypes'] = request.supportTypes;
  }
  if (!$isNull(request.uuid)) {
    body['Uuid'] = request.uuid;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'FindIdpListByLoginIdentifier',
    version = '2021-02-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'Anonymous',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 身份认证查询接口
 *
 * @param request FindIdpListByLoginIdentifierRequest
 * @return FindIdpListByLoginIdentifierResponse
 */
async function findIdpListByLoginIdentifier(request: FindIdpListByLoginIdentifierRequest): FindIdpListByLoginIdentifierResponse {
  var runtime = new $RuntimeOptions{};
  return findIdpListByLoginIdentifierWithOptions(request, runtime);
}

model GetLoginTokenRequest {
  authenticationCode?: string(name='AuthenticationCode', example='182901'),
  availableFeatures?: map[string]string(name='AvailableFeatures'),
  clientId?: string(name='ClientId', description='This parameter is required.', example='05967f80-6f51-46cb-a27c-****'),
  clientName?: string(name='ClientName'),
  clientOS?: string(name='ClientOS', example='windows_\\\\"Windows 10 Pro\\\\" 10.0 (Build 22631)'),
  clientType?: string(name='ClientType', example='windows'),
  clientVersion?: string(name='ClientVersion', example='7.3.0-20240619.143924'),
  currentStage?: string(name='CurrentStage', example='SsoTokenLogin'),
  directoryId?: string(name='DirectoryId', example='cn-beijing+dir-j9dd****'),
  encryptedFingerPrintData?: string(name='EncryptedFingerPrintData', example='null'),
  encryptedKey?: string(name='EncryptedKey', example='4d7****8e90bb0484fc'),
  encryptedPassword?: string(name='EncryptedPassword', example='04d7****8e90bb0484fc;gJ1GLca1vQRRqQbRvByU0A==;5kOWZE7AtbQhki+4LAo69A=='),
  endUserId?: string(name='EndUserId', example='user01'),
  fingerPrintData?: string(name='FingerPrintData', example='null'),
  idpId?: string(name='IdpId', example='idp-iwntrlbb98q7v****'),
  imageUrl?: string(name='ImageUrl', example='null'),
  keepAlive?: boolean(name='KeepAlive', example='true'),
  keepAliveToken?: string(name='KeepAliveToken', example='00ugamMAoO1+u1MlhmgCeZJ75q094x3H/4kg7ZaTI3f/joVTVPIpJgfv9JFkPLNxnQjblrvsByNas08mc6FtVWvQPOE68fqmt6QMM4UbRtahm8luxEXvicF58qSPXW1hxOtV/Ev6d92VBz2Bck/N4CYyjD0iLocfN8jkBnt231****'),
  loginIdentifier?: string(name='LoginIdentifier', example='Fe04****'),
  loginName?: string(name='LoginName', example='null'),
  mfaType?: string(name='MfaType'),
  networkType?: string(name='NetworkType', example='INTERNET'),
  newPassword?: string(name='NewPassword', example='Admin@1234****'),
  officeSiteId?: string(name='OfficeSiteId', example='cn-beijing+dir-j9dd****'),
  oldPassword?: string(name='OldPassword', example='Admin@1234****'),
  password?: string(name='Password', example='Admin@1234****'),
  phone?: string(name='Phone', example='1822727****'),
  phoneVerifyCode?: string(name='PhoneVerifyCode', example='321123'),
  profileRegion?: string(name='ProfileRegion'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  sessionId?: string(name='SessionId', example='c6f3cd91-65fc-4c7b-b189-2a73da0****'),
  ssoExtendsCookies?: string(name='SsoExtendsCookies', example='null'),
  ssoSessionToken?: string(name='SsoSessionToken', example='04d707a6-fb23-44a7-aae7-8e90****'),
  tokenCode?: string(name='TokenCode', example='1234***'),
  umidToken?: string(name='UmidToken', example='04d707a6-fb23-44a7-aae7-8e90bb04****'),
  uuid?: string(name='Uuid', example='C50973691A6D2BE23F2CDD73B85B****'),
}

model GetLoginTokenShrinkRequest {
  authenticationCode?: string(name='AuthenticationCode', example='182901'),
  availableFeaturesShrink?: string(name='AvailableFeatures'),
  clientId?: string(name='ClientId', description='This parameter is required.', example='05967f80-6f51-46cb-a27c-****'),
  clientName?: string(name='ClientName'),
  clientOS?: string(name='ClientOS', example='windows_\\\\"Windows 10 Pro\\\\" 10.0 (Build 22631)'),
  clientType?: string(name='ClientType', example='windows'),
  clientVersion?: string(name='ClientVersion', example='7.3.0-20240619.143924'),
  currentStage?: string(name='CurrentStage', example='SsoTokenLogin'),
  directoryId?: string(name='DirectoryId', example='cn-beijing+dir-j9dd****'),
  encryptedFingerPrintData?: string(name='EncryptedFingerPrintData', example='null'),
  encryptedKey?: string(name='EncryptedKey', example='4d7****8e90bb0484fc'),
  encryptedPassword?: string(name='EncryptedPassword', example='04d7****8e90bb0484fc;gJ1GLca1vQRRqQbRvByU0A==;5kOWZE7AtbQhki+4LAo69A=='),
  endUserId?: string(name='EndUserId', example='user01'),
  fingerPrintData?: string(name='FingerPrintData', example='null'),
  idpId?: string(name='IdpId', example='idp-iwntrlbb98q7v****'),
  imageUrl?: string(name='ImageUrl', example='null'),
  keepAlive?: boolean(name='KeepAlive', example='true'),
  keepAliveToken?: string(name='KeepAliveToken', example='00ugamMAoO1+u1MlhmgCeZJ75q094x3H/4kg7ZaTI3f/joVTVPIpJgfv9JFkPLNxnQjblrvsByNas08mc6FtVWvQPOE68fqmt6QMM4UbRtahm8luxEXvicF58qSPXW1hxOtV/Ev6d92VBz2Bck/N4CYyjD0iLocfN8jkBnt231****'),
  loginIdentifier?: string(name='LoginIdentifier', example='Fe04****'),
  loginName?: string(name='LoginName', example='null'),
  mfaType?: string(name='MfaType'),
  networkType?: string(name='NetworkType', example='INTERNET'),
  newPassword?: string(name='NewPassword', example='Admin@1234****'),
  officeSiteId?: string(name='OfficeSiteId', example='cn-beijing+dir-j9dd****'),
  oldPassword?: string(name='OldPassword', example='Admin@1234****'),
  password?: string(name='Password', example='Admin@1234****'),
  phone?: string(name='Phone', example='1822727****'),
  phoneVerifyCode?: string(name='PhoneVerifyCode', example='321123'),
  profileRegion?: string(name='ProfileRegion'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  sessionId?: string(name='SessionId', example='c6f3cd91-65fc-4c7b-b189-2a73da0****'),
  ssoExtendsCookies?: string(name='SsoExtendsCookies', example='null'),
  ssoSessionToken?: string(name='SsoSessionToken', example='04d707a6-fb23-44a7-aae7-8e90****'),
  tokenCode?: string(name='TokenCode', example='1234***'),
  umidToken?: string(name='UmidToken', example='04d707a6-fb23-44a7-aae7-8e90bb04****'),
  uuid?: string(name='Uuid', example='C50973691A6D2BE23F2CDD73B85B****'),
}

model GetLoginTokenResponseBody = {
  accessType?: string(name='AccessType', example='INTERNET'),
  accountType?: string(name='AccountType', example='ad'),
  adDomain?: string(name='AdDomain', example='easthp***.com'),
  email?: string(name='Email', example='alice***@aliyun.com'),
  endUserId?: string(name='EndUserId', example='alice'),
  idpId?: string(name='IdpId', example='idp-7ttvs4ove8bo5***'),
  industry?: string(name='Industry', example='edu'),
  keepAliveToken?: string(name='KeepAliveToken', example='006YwvYMsesWWsDBZnVB+Wq9AvJDVIqOY3YCktvtb7+KxMb3ClnNlV8+l/knhZYrXUmeP06IzkjF+IgcZ3vZKOyMprDyFHjCy1r27FRE/U7+geWCl8iQ+yF8GaCRHfJEkC2+ROs93HkT4tfHxyY1J8W7O7ZQGUC/cdCvm+cCP6FIy73IUuPuVR6PcKYXIp***'),
  label?: string(name='Label', example='test:wuying'),
  loginToken?: string(name='LoginToken', example='v185fdd7f6d39fa7861981639366085772e150a390a5bb7b43c4e62440d94fc392b945770e1596cebe90085ce0af4d****'),
  mfaTypeList?: [ 
    {
      name?: string(name='Name'),
      stage?: string(name='Stage'),
    }
  ](name='MfaTypeList'),
  nextStage?: string(name='NextStage', example='MFABind'),
  nickName?: string(name='NickName'),
  officeSites?: [ string ](name='OfficeSites'),
  passwordStrategy?: {
    tenantAlternativeChars?: [ string ](name='TenantAlternativeChars'),
    tenantPasswordLength?: int32(name='TenantPasswordLength', example='12'),
  }(name='PasswordStrategy'),
  phone?: string(name='Phone', example='1826717****'),
  props?: map[string]string(name='Props'),
  qrCodePng?: string(name='QrCodePng', example='5OCLLKKOJU5HPBX66H3QCTWY******'),
  reason?: string(name='Reason', example='PasswordExpired'),
  requestId?: string(name='RequestId', example='EEA72491-B731-53D6-83ED-209769D6****'),
  riskVerifyInfo?: {
    email?: string(name='Email', example='ppas***@aliyun.com'),
    lastLockDuration?: long(name='LastLockDuration', example='12000'),
    locked?: boolean(name='Locked', example='true'),
    phone?: string(name='Phone', example='1826717****'),
  }(name='RiskVerifyInfo'),
  secret?: string(name='Secret', example='4JZNSDHDM3T6AZ4G2O5OWXBLLE4P****'),
  sessionId?: string(name='SessionId', example='cc15c91c-821b-4edd-9af2-6df66cc****'),
  tenantAlias?: string(name='TenantAlias', example='Rq201***'),
  tenantId?: long(name='TenantId', example='13747924304****'),
  tenantInfos?: [ 
    {
      accessType?: string(name='AccessType', example='INTERNET'),
      tenantAlias?: string(name='TenantAlias', example='Up830***'),
    }
  ](name='TenantInfos'),
  vpcRegionId?: string(name='VpcRegionId', example='cn-beijing'),
  windowDisplayMode?: string(name='WindowDisplayMode', example='Windowed'),
  wyId?: string(name='WyId', example='0aba1403b337a***'),
}

model GetLoginTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLoginTokenResponseBody(name='body'),
}

/**
 * @summary GetLoginToken
 *
 * @param tmpReq GetLoginTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLoginTokenResponse
 */
async function getLoginTokenWithOptions(tmpReq: GetLoginTokenRequest, runtime: $RuntimeOptions): GetLoginTokenResponse {
  tmpReq.validate();
  var request = new GetLoginTokenShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.availableFeatures)) {
    request.availableFeaturesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.availableFeatures, 'AvailableFeatures', 'json');
  }
  var query = {};
  if (!$isNull(request.authenticationCode)) {
    query['AuthenticationCode'] = request.authenticationCode;
  }
  if (!$isNull(request.availableFeaturesShrink)) {
    query['AvailableFeatures'] = request.availableFeaturesShrink;
  }
  if (!$isNull(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  if (!$isNull(request.clientName)) {
    query['ClientName'] = request.clientName;
  }
  if (!$isNull(request.clientOS)) {
    query['ClientOS'] = request.clientOS;
  }
  if (!$isNull(request.clientType)) {
    query['ClientType'] = request.clientType;
  }
  if (!$isNull(request.clientVersion)) {
    query['ClientVersion'] = request.clientVersion;
  }
  if (!$isNull(request.currentStage)) {
    query['CurrentStage'] = request.currentStage;
  }
  if (!$isNull(request.directoryId)) {
    query['DirectoryId'] = request.directoryId;
  }
  if (!$isNull(request.encryptedFingerPrintData)) {
    query['EncryptedFingerPrintData'] = request.encryptedFingerPrintData;
  }
  if (!$isNull(request.encryptedKey)) {
    query['EncryptedKey'] = request.encryptedKey;
  }
  if (!$isNull(request.encryptedPassword)) {
    query['EncryptedPassword'] = request.encryptedPassword;
  }
  if (!$isNull(request.endUserId)) {
    query['EndUserId'] = request.endUserId;
  }
  if (!$isNull(request.fingerPrintData)) {
    query['FingerPrintData'] = request.fingerPrintData;
  }
  if (!$isNull(request.idpId)) {
    query['IdpId'] = request.idpId;
  }
  if (!$isNull(request.imageUrl)) {
    query['ImageUrl'] = request.imageUrl;
  }
  if (!$isNull(request.keepAlive)) {
    query['KeepAlive'] = request.keepAlive;
  }
  if (!$isNull(request.keepAliveToken)) {
    query['KeepAliveToken'] = request.keepAliveToken;
  }
  if (!$isNull(request.loginIdentifier)) {
    query['LoginIdentifier'] = request.loginIdentifier;
  }
  if (!$isNull(request.loginName)) {
    query['LoginName'] = request.loginName;
  }
  if (!$isNull(request.mfaType)) {
    query['MfaType'] = request.mfaType;
  }
  if (!$isNull(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!$isNull(request.newPassword)) {
    query['NewPassword'] = request.newPassword;
  }
  if (!$isNull(request.officeSiteId)) {
    query['OfficeSiteId'] = request.officeSiteId;
  }
  if (!$isNull(request.oldPassword)) {
    query['OldPassword'] = request.oldPassword;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  if (!$isNull(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!$isNull(request.phoneVerifyCode)) {
    query['PhoneVerifyCode'] = request.phoneVerifyCode;
  }
  if (!$isNull(request.profileRegion)) {
    query['ProfileRegion'] = request.profileRegion;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.ssoExtendsCookies)) {
    query['SsoExtendsCookies'] = request.ssoExtendsCookies;
  }
  if (!$isNull(request.ssoSessionToken)) {
    query['SsoSessionToken'] = request.ssoSessionToken;
  }
  if (!$isNull(request.tokenCode)) {
    query['TokenCode'] = request.tokenCode;
  }
  if (!$isNull(request.umidToken)) {
    query['UmidToken'] = request.umidToken;
  }
  if (!$isNull(request.uuid)) {
    query['Uuid'] = request.uuid;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetLoginToken',
    version = '2021-02-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'Anonymous',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary GetLoginToken
 *
 * @param request GetLoginTokenRequest
 * @return GetLoginTokenResponse
 */
async function getLoginToken(request: GetLoginTokenRequest): GetLoginTokenResponse {
  var runtime = new $RuntimeOptions{};
  return getLoginTokenWithOptions(request, runtime);
}

model GetStsTokenRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='e4e169bea1cc48e8afac53**********'),
  clientId?: string(name='ClientId', example='eac19bef-1e45-4190-a03a-4ea74b69****'),
  clientIp?: string(name='ClientIp', example='22.21.2.**'),
  clientOS?: string(name='ClientOS', example='windows_\\\\"Windows 10 Enterprise\\\\" 10.0 (Build 14393)'),
  clientVersion?: string(name='ClientVersion', example='6.3.0-R-20231106.210000'),
  uuid?: string(name='Uuid', example='2943802884B27030B6759F9132B2****'),
}

model GetStsTokenResponseBody = {
  requestId?: string(name='RequestId', example='CCF92035-6231-5ABB-930E-1E003C32****'),
  stsTokenModel?: {
    sessionId?: string(name='SessionId', example='be4be09e-cd00-4b4c-add7-11b4d8****'),
    stsToken?: string(name='StsToken', example='sts****'),
    tenantId?: long(name='TenantId', example='105552640689****'),
  }(name='StsTokenModel'),
}

model GetStsTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetStsTokenResponseBody(name='body'),
}

/**
 * @summary 获取无影StsToken
 *
 * @param request GetStsTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetStsTokenResponse
 */
async function getStsTokenWithOptions(request: GetStsTokenRequest, runtime: $RuntimeOptions): GetStsTokenResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.authCode)) {
    body['AuthCode'] = request.authCode;
  }
  if (!$isNull(request.clientId)) {
    body['ClientId'] = request.clientId;
  }
  if (!$isNull(request.clientIp)) {
    body['ClientIp'] = request.clientIp;
  }
  if (!$isNull(request.clientOS)) {
    body['ClientOS'] = request.clientOS;
  }
  if (!$isNull(request.clientVersion)) {
    body['ClientVersion'] = request.clientVersion;
  }
  if (!$isNull(request.uuid)) {
    body['Uuid'] = request.uuid;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetStsToken',
    version = '2021-02-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'Anonymous',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取无影StsToken
 *
 * @param request GetStsTokenRequest
 * @return GetStsTokenResponse
 */
async function getStsToken(request: GetStsTokenRequest): GetStsTokenResponse {
  var runtime = new $RuntimeOptions{};
  return getStsTokenWithOptions(request, runtime);
}

model RefreshLoginTokenRequest {
  clientId?: string(name='ClientId', description='This parameter is required.', example='f4a0dc8e-1702-4728-9a60-95b27a35****'),
  clientType?: string(name='ClientType', example='windows'),
  endUserId?: string(name='EndUserId', example='alice'),
  loginIdentifier?: string(name='LoginIdentifier', example='Alibaba****'),
  loginToken?: string(name='LoginToken', description='This parameter is required.', example='v1046341d8d4e2f05c4aa168196009613594aaf451499bfc75e54699efa7230bc968e1debb1fa4063b01e5d327b467****'),
  officeSiteId?: string(name='OfficeSiteId', example='cn-shenzhen+dir-436909****'),
  profileRegion?: string(name='ProfileRegion'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='6442b2fd-ed3e-423a-8e6e-352d26a4****'),
  uuid?: string(name='Uuid', example='2943802884B27030B6759F9132B2****'),
}

model RefreshLoginTokenResponseBody = {
  loginToken?: string(name='LoginToken', example='v12369636c721ba6b3ddb1683341016775c3f63e4d0e78f120f9a0544ed826b7af7daf747c402f0d0730b52f451b70****'),
  requestId?: string(name='RequestId', example='419F31B9-1FDF-5644-ABA3-D00026FA****'),
}

model RefreshLoginTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshLoginTokenResponseBody(name='body'),
}

/**
 * @param request RefreshLoginTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshLoginTokenResponse
 */
async function refreshLoginTokenWithOptions(request: RefreshLoginTokenRequest, runtime: $RuntimeOptions): RefreshLoginTokenResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  if (!$isNull(request.clientType)) {
    query['ClientType'] = request.clientType;
  }
  if (!$isNull(request.endUserId)) {
    query['EndUserId'] = request.endUserId;
  }
  if (!$isNull(request.loginIdentifier)) {
    query['LoginIdentifier'] = request.loginIdentifier;
  }
  if (!$isNull(request.loginToken)) {
    query['LoginToken'] = request.loginToken;
  }
  if (!$isNull(request.officeSiteId)) {
    query['OfficeSiteId'] = request.officeSiteId;
  }
  if (!$isNull(request.profileRegion)) {
    query['ProfileRegion'] = request.profileRegion;
  }
  if (!$isNull(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.uuid)) {
    query['Uuid'] = request.uuid;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RefreshLoginToken',
    version = '2021-02-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'Anonymous',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RefreshLoginTokenRequest
 * @return RefreshLoginTokenResponse
 */
async function refreshLoginToken(request: RefreshLoginTokenRequest): RefreshLoginTokenResponse {
  var runtime = new $RuntimeOptions{};
  return refreshLoginTokenWithOptions(request, runtime);
}

